Skip to content

fix: notes merge fallback and retry for busy monorepos#815

Open
svarlamov wants to merge 3 commits intomainfrom
fix/notes-merge-fallback-and-retry
Open

fix: notes merge fallback and retry for busy monorepos#815
svarlamov wants to merge 3 commits intomainfrom
fix/notes-merge-fallback-and-retry

Conversation

@svarlamov
Copy link
Copy Markdown
Member

@svarlamov svarlamov commented Mar 26, 2026

Summary

  • Adds fast-import based fallback when git notes merge -s ours crashes (assertion failure in git's notes-merge.c on corrupted/mixed-fanout trees)
  • Adds fetch-merge-push retry loop (3 attempts) to handle concurrent push races on busy monorepos
  • Fallback merge is O(1) git process invocations via fast-import regardless of note count

Test plan

  • test_push_authorship_notes_survives_corrupted_remote_notes_tree — reproduces the exact assertion crash, verifies fallback succeeds
  • test_push_authorship_notes_retries_on_concurrent_push — simulates concurrent push race, verifies retry loop succeeds
  • Existing test_fetch_and_push_authorship_notes_internal_commands_json still passes

🤖 Generated with Claude Code


Open with Devin

svarlamov and others added 2 commits March 28, 2026 01:16
When `git notes merge -s ours` crashes (assertion failure in
notes-merge.c due to mixed-fanout trees or version-specific bugs),
fall back to a fast-import based merge that produces a clean notes
tree in a single process invocation.

Also adds a retry loop (up to 3 attempts) for the full
fetch-merge-push cycle to handle concurrent push races on busy
monorepos where the remote notes ref moves between merge and push.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cargo fmt, and pass -c user.name/user.email in git_plumbing() so
commit-tree works in CI where no global git identity is configured.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@svarlamov svarlamov force-pushed the fix/notes-merge-fallback-and-retry branch from 9656775 to 56b0a07 Compare March 28, 2026 01:19
derive_directory_from_url only checked for '/' as a path separator,
so on Windows local paths like C:\path\to\repo.git it fell through to
the ':' (SCP-like) check and matched the drive letter colon, producing
an incorrect target directory. Now checks both '/' and '\\'.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@svarlamov svarlamov marked this pull request as ready for review March 28, 2026 16:36
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant